<!DOCTYPE html>
<html>
<head>
<title>Drudge Report Options</title>
</head>
<script type="text/javascript">
// Saves options to localStorage.
function save_options() {
	var nsSelect = document.getElementById("numberStories");
	var rrSelect = document.getElementById("refreshRate");
	var numberStories = nsSelect.children[nsSelect.selectedIndex].value;
	var refreshRate = rrSelect.children[rrSelect.selectedIndex].value;
	localStorage["numberStories"] = numberStories;
	localStorage["refreshRate"] = refreshRate;
}

// Restores select box states to saved values from localStorage.
function restore_options() {
	var nsFavorite = localStorage["numberStories"];
	var rrFavorite = localStorage["refreshRate"];
	if (!nsFavorite || !rrFavorite) {
		return;
	}
	var nsSelect = document.getElementById("numberStories");
	for (var i = 0; i < nsSelect.children.length; i++) {
		var child = nsSelect.children[i];
		if (child.value == nsFavorite) {
			child.selected = "true";
			break;
		}
	}
	var rrSelect = document.getElementById("refreshRate");
	for (var i = 0; i < rrSelect.children.length; i++) {
		var child = rrSelect.children[i];
		if (child.value == rrFavorite) {
			child.selected = "true";
			break;
		}
	}
}

</script>

<body onload="restore_options()">
<font face="impact"><i><h1>Drudge Report Options</h1></i></font>
<table border="0">
<tr>
<td align="left">
Maximum Number of Stories: 
</td>
<td align="right">
<select id="numberStories">
	<option value="5">5</option>
	<option value="10">10</option>
	<option value="25">25</option>
   <option value="50">50</option>
	<option value="100">100</option>
</select>
</td>
</tr>
<tr>
<td align="left">
Check for Updates Every:
</td>
<td align="right">
<select id="refreshRate">
	<option value="1">1 Minute</option>
	<option value="2">2 Minutes</option>
	<option value="3">3 Minutes</option>
	<option value="4">4 Minutes</option>
	<option value="50">50 Minutes</option>
	<option value="180">3 Hours</option>
</select>
</td>
</tr>
</table>
<br>
<button onclick="save_options()">Save</button>
</body>
</html>